Skip to content

refactor: migrate to openpgp/v3 library - #676

Merged
talos-bot merged 1 commit into
cosi-project:mainfrom
smira:refactor/openpgp-v3
Aug 13, 2026
Merged

refactor: migrate to openpgp/v3 library#676
talos-bot merged 1 commit into
cosi-project:mainfrom
smira:refactor/openpgp-v3

Conversation

@smira

@smira smira commented Aug 12, 2026

Copy link
Copy Markdown
Member

The v2 library is in maintenance mode, good time to move on to the new library.

Provides tests on backwards compatibility, the protobuf marshaling is compatible v2->v3 and v3->v2.

Copilot AI lite review requested due to automatic review settings August 12, 2026 18:12
@talos-bot talos-bot moved this to In Review in Planning Aug 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates pkg/keystorage from github.com/ProtonMail/gopenpgp/v2 to github.com/ProtonMail/gopenpgp/v3 for encrypting/decrypting key slots, and introduces a golden v2-produced keystorage blob to validate post-migration readability.

Changes:

  • Replace gopenpgp/v2 helper-based slot encryption/decryption with gopenpgp/v3 crypto APIs, using a lazily-initialized PGP handle.
  • Store armored ciphertext as []byte directly (instead of converting from string) in protobuf key slots.
  • Add a v2 marshaled keystorage test vector and a test ensuring v2-produced data can be unmarshaled and decrypted after the migration.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/keystorage/testdata/keystorage-v2.bin Adds a golden v2-produced serialized keystorage payload used for compatibility testing.
pkg/keystorage/keystorage.go Switches slot encryption/decryption implementation to gopenpgp/v3 and introduces encryptSlot/decryptSlot helpers.
pkg/keystorage/keystorage_test.go Embeds the v2 golden payload and adds a test for reading v2-produced keystorage.
go.mod Updates dependency from gopenpgp/v2 to gopenpgp/v3.
go.sum Adjusts module checksums to reflect the dependency migration and indirect dependency changes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/keystorage/keystorage_test.go
Comment thread pkg/keystorage/keystorage.go Outdated
Comment thread pkg/keystorage/keystorage_test.go Outdated
@github-project-automation github-project-automation Bot moved this from In Review to Approved in Planning Aug 12, 2026
The v2 library is in maintenance mode, good time to move on to the new
library.

Provides tests on backwards compatibility, the protobuf marshaling is
compatible v2->v3 and v3->v2.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
@smira
smira force-pushed the refactor/openpgp-v3 branch from 921c4d5 to c7cf050 Compare August 13, 2026 12:47
@smira

smira commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

/m

@talos-bot

Copy link
Copy Markdown
Collaborator

@smira merge was not performed: no reviews found

1 similar comment
@talos-bot

Copy link
Copy Markdown
Collaborator

@smira merge was not performed: no reviews found

@smira

smira commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

/m

@talos-bot

Copy link
Copy Markdown
Collaborator

@smira merge was not performed: no reviews found

1 similar comment
@talos-bot

Copy link
Copy Markdown
Collaborator

@smira merge was not performed: no reviews found

@talos-bot
talos-bot merged commit c7cf050 into cosi-project:main Aug 13, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in Planning Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants